package com.htt.bms.common.exception;

import lombok.Getter;

/**
 * @author 侯婷婷
 * @version 1.0
 * @description 业务异常处理
 */
@Getter
public class BusinessException extends RuntimeException{

    //异常码
    private Integer code = 500;

    //异常描述
    private String message;

    //信息
    public BusinessException(String message){
        this.message = message;
    }

    //状态码+信息
    public BusinessException(Integer code, String message){
        this.code = code;
        this.message = message;
    }

    //状态码+信息+具体异常对象
    public BusinessException(Integer code, String message, Throwable throwable){
        //throwable: 具体抛出的异常
        super(message,throwable);
        this.code = code;
        this.message = message;
    }


}
